package com.zbs.framework.dao.passport.normal.repository;

import com.zbs.framework.dao.passport.entity.MNNormal;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MNNormalRepository extends JpaRepository<MNNormal, Long>, JpaSpecificationExecutor<MNNormal> {

    /**
     * 根据用户名查找账号
     * @param username
     * @return
     */
    MNNormal findByUsernameAndDeleted(String username,Integer deleted);

    /**
     * 根据Account的uuid查找账号
     * @param uuid
     * @return
     */
    MNNormal findByAcctUuidAndDeleted(String uuid,Integer deleted);


    List<MNNormal> findAllByAcctUuid(String uuid);

    /**
     * 删除用户下的所有账号
     * @param uuid
     */
    void deleteAllByAcctUuid(String uuid);
}
